@extends('layout.adminlayout')
@section('css')
 <script src="/admin/js/metisMenu.min.js"></script>
 <script src="/admin/js/custom.js"></script>
 <link href="/admin/css/custom.css" rel="stylesheet">
 <style>
    
        th,td {
          border: 0.1em solid #ccc !important
        }
    
    </style>
@endsection
@section('content')
     <div class="tables"> 
      <div class="table-responsive bs-example widget-shadow"> 
       <h4 style="margin-bottom: 15px;">建筑列表 :</h4> 
       <form action="/admin/building/index" method="get">
        <div class="row" style="padding-bottom: 15px;margin-top: 0px;"> 
         <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float: left;top: 5px;">代理商：</p> 
         <select name="ag" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 5px 10px; width: 64%;float: right;">
          <option value="">请选择代理商</option>
          @foreach($agent as $v)
           <option value="{{$v['id']}}"
                   @if($get['ag'] == $v['id'])
                   selected
                   @else
                   @if(Cookie::get('agentId') == $v['id'])
                   selected
                   @endif
                   @endif>{!! $v['agent_name'] !!}</option>
          @endforeach
         </select>
         <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px; float: left;top: 8px;">建筑：</p> 
         <input type="text" name="building" value="{{$get['building']}}" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 0px 10px; width: 64%;float: right; margin-bottom: 5px;" />
         <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;float: left;top: 10px;">区域：</p> 
         <input type="text" name="area" id="" value="{{$get['area']}}" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 0px 10px; width: 64%;float: right;" />
         <!-- <p class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="width: 70px; height: 32px;padding: 0px;text-align: right;line-height: 32px;">管理员：</p>						 --> 
         <!-- <input type="text" name="principal" id="" value="" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 30px; line-height: 30px; padding: 0px; border: 1px solid #DDD; margin: 0px 10px; width: 15%;"/> --> 
         <input type="submit" value="搜索" class="col-lg-1 col-md-1 col-sm-1 col-xs-1" style="height: 32px; line-height: 32px; padding: 0px; border: 0; background: #4F52BA;width: 91%; margin: 0px 10px;color:#fff;top: 5px;margin-left: 15px; " /> 
        </div> 
       </form> 
       <table class="table table-bordered"> 
        <!-- <thead>
 				<tr>
 				
					
					
					
				
					
				</tr>
			</thead> --> 
        <tbody>
        @if(!null==$info)
         @foreach($info as $v)
         <tr> 
         </tr>
         <tr> 
          <th style="text-align: center">建筑编号</th> 
          <th scope="row" style="text-align: center">{{$v['b_id']}}</th>
         </tr> 
         <tr> 
          <th style="text-align: center">建筑名称</th> 
          <td style="text-align: center">{{$v['b_name']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">所属区域</th> 
          <td style="text-align: center">{{$v['a_name']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">坐标</th> 
          <td style="text-align: center">{{$v['b_longitude']}}°E,{{$v['b_latitude']}}°N</td>
         </tr> 
         <tr> 
          <th style="text-align: center">总楼层</th> 
          <td style="text-align: center">{{$v['b_total_floor']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">最低层</th> 
          <td style="text-align: center">{{$v['b_low_floor']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">最高层</th> 
          <td style="text-align: center">{{$v['b_high_floor']}}</td>
         </tr> 
         <tr> 
          <th style="text-align: center">负责人</th> 
          <td style="text-align: center">{{$v['mma_username']}}</td>
         </tr> 
         <tr> 
         </tr>
          @if($get['ag'] == Cookie::get('agentId') || Cookie::get('agentId') == 1)
          <tr>
           <th style="text-align: center">操作</th>
           <td style="text-align: center">
            <a href="/admin/building/edit?b_id={{$v['b_id']}}">修改</a>|<a href="/admin/building/delete?id={{base64_encode($v['b_id'])}}">删除</a></td>
          </tr>
          @endif
         @endforeach
        @endif
        </tbody> 
       </table>
       @if(!null == $data)
        <div style="float:right;">
         {!! $data->appends($request)->render() !!}
        </div>
       @endif
      </div> 
     </div>
@endsection